// Copyright 2009 Thiago H. de Paula Figueiredo
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package br.com.arsmachina.authorization.impl;

import br.com.arsmachina.authorization.SingleTypeAuthorizer;

/**
 * A {@link SingleTypeAuthorizer} denies access for everything for everyone. This class can be used
 * as is or used as a starting point for subclasses.
 * 
 * @author Thiago H. de Paula Figueiredo
 * @param <T> the type covered by this authorization service.
 */
public class DenyAllSingleTypeAuthorizer<T> extends AbstractSingleTypeAuthorizer<T> implements
		SingleTypeAuthorizer<T> {

	/**
	 * Constructor that receives the authorized type. 
	 * This constructor must not be used by subclasses.
	 * 
	 * @param clasz a {@link Class} instance. It cannot be null.
	 */
	public DenyAllSingleTypeAuthorizer(Class<T> clasz) {
		super(clasz);
	}

	/**
	 * Constructor without arguments. This constructor must be used by subclasses.
	 */
	protected DenyAllSingleTypeAuthorizer() {
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * 
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canStore()
	 */
	public boolean canStore() {
		return false;
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * 
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canUpdate()
	 */
	public boolean canUpdate() {
		return false;
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canUpdate(java.lang.Object)
	 */
	public boolean canUpdate(T object) {
		return false;
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canRemove()
	 */
	public boolean canRemove() {
		return false;
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canRemove(java.lang.Object)
	 */
	public boolean canRemove(T object) {
		return false;
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canSearch()
	 */
	public boolean canSearch() {
		return false;
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canRead()
	 */
	public boolean canRead() {
		return false;
	}

	/**
	 * Returns <code>false</code>.
	 * 
	 * @return <code>false</code>
	 * @see br.com.arsmachina.authorization.SingleTypeAuthorizer#canRead(java.lang.Object)
	 */
	public boolean canRead(T object) {
		return false;
	}

}
